﻿using PARK.Common.Const;
using PARK.Common.Entity;
using SqlSugar;
using System;
using Yitter.IdGenerator;

namespace PARK.BussinCache.Entitys.Entity
{
    /// <summary>
    /// 人脸识别记录
    /// </summary>
    [SugarTable("access_uni_Evt101004")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class UniEvt101004Entity
    {
        /// <summary>
        /// 自然主键
        /// </summary>
        [SugarColumn(ColumnName = "RdsId", IsPrimaryKey = true)]
        public string RdsId { get; set; }

        /// <summary>
        /// 记录唯一标识
        /// </summary>
        [SugarColumn(ColumnName = "eventGuid")]
        public string eventGuid { get; set; }
        /// <summary>
        /// 人员guid
        /// </summary>
        [SugarColumn(ColumnName = "admitGuid")]
        public string admitGuid { get; set; }
        /// <summary>
        /// 识别主体姓名
        /// </summary>
        [SugarColumn(ColumnName = "admitName")]
        public string admitName { get; set; }
        /// <summary>
        /// 人员比对结果,1:比对成功 2:比对失败
        /// </summary>
        [SugarColumn(ColumnName = "type")]
        public int type { get; set; }
        /// <summary>
        /// 设备id
        /// </summary>
        [SugarColumn(ColumnName = "CtlId")]
        public string CtlId { get; set; }        
        /// <summary>
        /// 设备序列号
        /// </summary>
        [SugarColumn(ColumnName = "deviceNo")]
        public string deviceNo { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        [SugarColumn(ColumnName = "deviceName")]
        public string deviceName { get; set; }
        /// <summary>
        /// 设备位置
        /// </summary>
        [SugarColumn(ColumnName = "Ctlposition")]
        public string Ctlposition { get; set; }
        /// <summary>
        /// 门禁区域id
        /// </summary>
        [SugarColumn(ColumnName = "DoorAreaId")]
        public string DoorAreaId { get; set; }
        /// <summary>
        /// 门禁区域名称
        /// </summary>
        [SugarColumn(ColumnName = "DoorAreaName")]
        public string DoorAreaName { get; set; }
        /// <summary>
        /// 记录是否用户考勤
        /// </summary>
        [SugarColumn(ColumnName = "IsAtt")]
        public int IsAtt { get; set; }
        /// <summary>
        /// 识别卡号
        /// </summary>
        [SugarColumn(ColumnName = "cardNo")]
        public string cardNo { get; set; }
        /// <summary>
        /// 活体结果 1:活体判断成功 2:活体判断失败 3:未进行活体判断
        /// </summary>
        [SugarColumn(ColumnName = "aliveType")]
        public int aliveType { get; set; }
        /// <summary>
        /// 设备来源
        /// </summary>
        [SugarColumn(ColumnName = "source")]
        public string source { get; set; }
        /// <summary>
        /// 比对模式,1:本地识别 2:云端识别
        /// </summary>
        [SugarColumn(ColumnName = "recType")]
        public int recType { get; set; }
        /// <summary>
        /// 当前时间戳
        /// </summary>
        [SugarColumn(ColumnName = "timestamp")]
        public string timestamp { get; set; }
        /// <summary>
        /// 当前时间戳_转时间
        /// </summary>
        [SugarColumn(ColumnName = "timestampDate")]
        public DateTime timestampDate { get; set; }        
        /// <summary>
        /// 识别模式,1:人像识别, 2:刷卡识别 ,3:人卡合一 4,人证比对 5:按钮开门 6：远程开门 7:密码识别 8：人+密码开门 9:口罩测温检测 10:二维码识别 11: 刷身份证 12:指纹识别
        /// </summary>
        [SugarColumn(ColumnName = "recMode")]
        public string recMode { get; set; }
        /// <summary>
        /// 识别记录时间戳
        /// </summary>
        [SugarColumn(ColumnName = "showTime")]
        public string showTime { get; set; }
        /// <summary>
        /// 识别记录时间戳_转时间
        /// </summary>
        [SugarColumn(ColumnName = "showTimeDate")]
        public DateTime? showTimeDate { get; set; }        
        /// <summary>
        /// 现场照url
        /// </summary>
        [SugarColumn(ColumnName = "filePath")]
        public string filePath { get; set; }

        /// <summary>
        /// 软件版本号
        /// </summary>
        [SugarColumn(ColumnName = "deviceVersion")]
        public string deviceVersion { get; set; }
        /// <summary>
        /// 有效日期判断 1:有效期内 2:有效期外 3:未进行有效期判断
        /// </summary>
        [SugarColumn(ColumnName = "permissionTimeType")]
        public int permissionTimeType { get; set; }
        /// <summary>
        /// 有效时间段判断 1:时间段内 2:时间段外 3:未进行时间段判断
        /// </summary>
        [SugarColumn(ColumnName = "passTimeType")]
        public int passTimeType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "executeTime")]
        public string executeTime { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "executeTimeDate")]
        public DateTime? executeTimeDate { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "dataType")]
        public int dataType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "algActionId")]
        public int algActionId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "executeType")]
        public int executeType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "objectId")]
        public int objectId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "recModeType")]
        public int recModeType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "executeRet")]
        public int executeRet { get; set; }

        /// <summary>
        /// dbdate
        /// </summary>
        [SugarColumn(ColumnName = "dbdate")]
        public DateTime dbdate { get; set; }
        /// <summary>
        /// CompanyId
        /// </summary>
        [SugarColumn(ColumnName = "CompanyId")]
        public string CompanyId { get; set; }
        /// <summary>
        /// CompanyName
        /// </summary>
        [SugarColumn(ColumnName = "CompanyName")]
        public string CompanyName { get; set; }
        /// <summary>
        /// IsAny
        /// </summary>
        [SugarColumn(ColumnName = "IsAny")]
        public int IsAny { get; set; }
        /// <summary>
        /// Anydate
        /// </summary>
        [SugarColumn(ColumnName = "Anydate")]
        public DateTime? Anydate { get; set; }
        /// <summary>
        /// AnyResult
        /// </summary>
        [SugarColumn(ColumnName = "AnyResult")]
        public int AnyResult { get; set; }
        /// <summary>
        /// AnyMsg
        /// </summary>
        [SugarColumn(ColumnName = "AnyMsg")]
        public string AnyMsg { get; set; }

        /// <summary>
        /// 创建
        /// </summary>
        public virtual void Create()
        {
            this.RdsId = System.Guid.NewGuid().ToString();
            this.dbdate = DateTime.Now;
            this.IsAny = 0;
            this.AnyResult = 0;
        }
    }
}
